import tensorflow as tf
from tensorflow.keras import datasets

(x_train, y_train), (x_test, y_test) = datasets.cifar10.load_data()

print(x_train.shape)
print(y_train.shape)
print(x_test.shape)
print(y_test.shape)

print(x_train.min())
print(x_train.max())
print(x_train.mean())

print(y_train.min())
print(y_train.max())
print(y_train.mean())

print(y_train[:10])

print('-' * 200)

(x_train, y_train), (x_test, y_test) = datasets.cifar100.load_data()
print(x_train.shape)
print(y_train.shape)
print(x_test.shape)
print(y_test.shape)

print(x_train.min())
print(x_train.max())
print(x_train.mean())

print(y_train.min())
print(y_train.max())
print(y_train.mean())

print(y_train[:10])

db = tf.data.Dataset.from_tensor_slices((x_train, y_train))
it = iter(db)
temp = next(it)
print(temp[0].shape)
print(temp[1].shape)
# print(temp)

db.shuffle(10000)
it = iter(db)
temp = next(it)
print(temp[0].shape)
print(temp[1].shape)
# print(temp)
